<?php
	include 'commonAccountFunctions.php';
	session_start();
	$user = checkAuthentication();
	print_header();
	printCommonCP();
	if(getPermissions($user)==="labman"){
		printLabmanCP();
	} elseif(getPermissions($user)==="labins"){
		printLabinsCP();
	}
    else{ // someone dun tried to hack our system
		header('Location: index.php');
		exit();
	}
	?> </ul> </div> <?php
	
	print_footer();
	
		
	// void -> HTML
	// prints out the common HTML that all accounts see
	function printCommonCP(){
		global $user;
?>	
	<div id="topbar">
		<div id="title"> Lab-Check</div>
		<div id="rightbutton"> <a href="index.php" >Log Out</a> </div>
	</div>
	<div id="tributton">
		<div class="links">
			<a id="pressed" href="controlpanel.php">Control Panel</a><a href="changePassword.php">Change Password</a>
		</div>
	</div>

	<div id="content">
		<ul class="pageitem" style="padding:5px">
			<li class="userName"> <strong>User name:</strong>  <?=$user?> </li>
		</ul>
		<ul class="pageitem">
			<li class="menu"><a href="completedLists.php">
				<span class="name">View Completed Inspections</span><span class="arrow"></span></a></li>
		
	
<?php
	}
	
	// void -> HTML
	// prints out the HTML pertaining only to the lab manager
	function printLabmanCP(){
?>
		<li class="menu"><a href="newInspection.php">
			<span class="name">New and Incomplete Inspections</span><span class="arrow"></span></a></li>
		<li class="menu"><a href="manageUserAccounts.php">
			<span class="name">Manage User Accounts</span><span class="arrow"></span></a></li>

<?php
	}
	
	// void -> HTML
	// prints out the HTML pertaining only to the lab inspector
	function printLabinsCP(){
?>
		<li class="menu"><a href="newInspection.php">
			<span class="name">Inspect Lab</span><span class="arrow"></span></a></li>
<?php
	}

?>